package com.example.controller;

import com.example.pojo.Resume;
import com.example.pojo.ResumeFocus;
import com.example.service.IResumeFocusService;
import com.example.vo.ResultVo;
import com.example.vo.per.ResuSelAllPage;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;

import java.time.LocalDateTime;

/**
 * <p>
 * 简历关注表 前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-04-19
 */
@RestController
@RequestMapping("/resumeFocus")
@Api(tags = "简历关注表",value = "")
@CrossOrigin(allowCredentials = "true")
public class ResumeFocusController {

    @Autowired
    private IResumeFocusService irfs;

    @PostMapping("/rsfo")
    @ApiOperation("新增简历关注")
    public ResultVo insFocus(@RequestBody ResumeFocus rf){
        System.err.println(rf + " ------------------->");
        if (irfs.selInsUpt(rf) > 0) {
            return ResultVo.ok();
        }
        return ResultVo.error("关注失败！");
    }

    @GetMapping("")
    @ApiOperation("查询人才库")
    public PageInfo<Resume> selByAll(ResuSelAllPage rsap){
        System.out.println(rsap+"-------------------------------------------");
        return irfs.selByAllPag(rsap);
    }
}